import React from 'react'
import { Outlet, useLocation, useNavigate } from 'react-router-dom'

export default function Home() {
  const navigate = useNavigate();

  const toMusicHandle = () => {
    navigate("/main/home/music/002?user=李沛华", {
      state: [
        { id: "001", name: "最伟大的作品" },
        { id: "002", name: "夜曲" },
        { id: "003", name: "爷爷泡的茶" },
        { id: "004", name: "求佛" },
        { id: "005", name: "白狐" }
      ]
    })
  }

  const toNewsHandle = () => {
    navigate("/main/home/news/001/?user=李沛华", {
      state: [
        { id: "001", name: "空间站国旗与地球同框" },
        { id: "002", name: "罗永浩谈钟薛高卖得贵" },
        { id: "003", name: "麦当劳员工将掉地上面包放回货架" },
      ]
    })
  }
  return (
    <div>
      <h3>我是Home的内容</h3>
      <button onClick={toMusicHandle}>Music</button>
      <button onClick={toNewsHandle}>News</button>
      <Outlet />
    </div>
  )
}


/* var str = "a";

  // var re = str.toLowerCase();

  var _str = Object(str);
  var re = _str.toLowerCase();
  delete _str; */


/* var str = "a";
str.b = 1;

var _str = Object(str);
_str.b = 1;
delete _str;
*/

